<script type="text/html" template
        lay-url="{{ window.globalConfig.url_productCategory + '/' + layui.router().search.id }}"
        lay-done="layui.data.done(d);">
    <title>分类详情</title>

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">
                        <a href="javascript:history.back()"
                           class="layui-btn layui-btn-primary layui-btn-sm" id="goBack">返回上级</a>
                        {{ d.data.name || '' }}
                    </div>
                    <div class="layui-card-body">
                        <div class="layui-form" lay-filter="LAY-home-productCategory-listform"
                             id="LAY-home-productCategory-listform"
                             style="padding: 20px 30px 0 0;">

                            <div class="layui-tab layui-tab-brief">
                                <ul class="layui-tab-title">
                                    <li class="layui-this">基础信息</li>
<!--                                    <li>封面内容</li>-->
<!--                                    <li>内页内容</li>-->
<!--                                    <li>关联字段</li>-->
                                </ul>
                                <div class="layui-tab-content">

                                    <!-- 基础信息 -->
                                    <div class="layui-tab-item layui-show">
                                        <!-- 基本信息 -->
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">分类名称</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="name" value="{{ d.data.name || '' }}"
                                                       lay-verify="required"
                                                       placeholder="请输入分类名称" autocomplete="off"
                                                       class="layui-input"
                                                >
                                            </div>
                                        </div>

                                        <!-- 封面图片 -->
<!--                                        <div class="layui-form-item">-->
<!--                                            <label class="layui-form-label">封面图片</label>-->
<!--                                            <div class="layui-input-block">-->
<!--                                                <div class="layui-upload-list" id="ID-upload-productCategory-btn">-->

<!--                                                    <img-->
<!--                                                            {{# if(d.data.cover_img){ }}-->
<!--                                                            src="{{ window.globalConfig.img_bind_url + d.data.cover_img}}"-->
<!--                                                            {{# } else { }}-->
<!--                                                            src="./res/style/imgs/upload.png"-->
<!--                                                            {{# } }}-->

<!--                                                            id="ID-upload-productCategory-img" style="max-width: 200px"-->
<!--                                                            class="layui-upload-img">-->
<!--                                                </div>-->
<!--                                            </div>-->
<!--                                            <input type="hidden" name="cover_img" id="cover_img"-->
<!--                                                   value="{{ d.data.cover_img }}">-->
<!--                                        </div>-->


<!--                                        <div class="layui-form-item">-->
<!--                                            <label class="layui-form-label">详情封面</label>-->
<!--                                            <div class="layui-input-block">-->
<!--                                                <div class="layui-upload-list"-->
<!--                                                     id="ID-upload-productCategory-inner_img-btn">-->

<!--                                                    <img-->
<!--                                                            {{# if(d.data.inner_img){ }}-->
<!--                                                            src="{{ window.globalConfig.img_bind_url + d.data.inner_img}}"-->
<!--                                                            {{# } else { }}-->
<!--                                                            src="./res/style/imgs/upload.png"-->
<!--                                                            {{# } }}-->

<!--                                                            id="ID-upload-productCategory-inner_img-img"-->
<!--                                                            style="max-width: 200px"-->
<!--                                                            class="layui-upload-img">-->
<!--                                                </div>-->
<!--                                            </div>-->
<!--                                            <input type="hidden" name="inner_img" id="inner_img"-->
<!--                                                   value="{{ d.data.inner_img }}">-->
<!--                                        </div>-->

                                        <div class="layui-form-item">
                                            <label class="layui-form-label">是否显示</label>
                                            <div class="layui-input-inline">
                                                <input type="checkbox" name="is_show" title="开启|关闭" value="1"
                                                       lay-skin="switch"
                                                       {{# if(d.data.is_show){ }}
                                                       checked
                                                       {{# } }}
                                                >
                                            </div>
                                        </div>

                                        <!-- 静态地址 -->
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">静态地址</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="rewrite_url"
                                                       id="rewrite_url"
                                                       value="{{ d.data.rewrite_url || '' }}"
                                                       lay-verify="required"
                                                       placeholder="请输入静态地址" autocomplete="off"
                                                       class="layui-input">
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label">排序</label>
                                            <div class="layui-input-inline">
                                                <input type="number" name="sort" lay-affix="number" min="0"
                                                       value="{{ d.data.sort | 0 }}"
                                                       placeholder="请输入排序" autocomplete="off"
                                                       class="layui-input">
                                            </div>
                                        </div>

                                    </div>

                                    <!-- 封面内容 -->
<!--                                    <div class="layui-tab-item">-->
<!--                                        <div class="layui-form-item">-->
<!--                                            <label class="layui-form-label">分类描述内容</label>-->
<!--                                            <div class="layui-input-inline" style="width: 100%">-->
<!--                                                <div id="editor"></div>-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                    </div>-->

                                    <!-- 内页内容 -->
<!--                                    <div class="layui-tab-item">-->
<!--                                        &lt;!&ndash;  富文本  &ndash;&gt;-->
<!--                                        <div class="layui-form-item">-->
<!--                                            <label class="layui-form-label">内页内容</label>-->
<!--                                            <div class="layui-input-inline" style="width: 100%">-->
<!--                                                <div id="inner_content-editor"></div>-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                    </div>-->

                                    <!-- 关联字段 -->
                                    <div class="layui-tab-item">
                                        <div id="ID-transfer-products-category-fields"></div>
                                    </div>
                                </div>
                            </div>


                            <input type="hidden" name="parent_id" value="{{ layui.router().search.parent_id || null }}">
                            <input type="hidden" name="id" value="{{ d.data.id || null }}">
                            <div class="layui-form-item">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-inline">
                                    <input type="button" lay-submit
                                           lay-filter="LAY-home-productCategory-listform-submit"
                                           value="保存"
                                           class="layui-btn">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<script src="res/modules/productCategory.js"></script>
